package com.ljq.Repository;

import com.ljq.pojo.Account;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface AccountRepository extends JpaRepository<Account, Integer> {
    @Transactional
    @Modifying
    @Query("update  Account  a set a.password=?2 ,a.username = ?3 where a.id = ?1")
    int updateAccount(int id,String newPassword,String newUsername);
}
